import request from '@/utils/request';

/**
 *获取新闻列表
 *
 * @export POST
 * @param {integer} pageNo 页码
 * @param {integer} pageSize 分页条数
 * @param {integer} sort 排序
 * @param {string} keyword 搜索内容
 * @returns
 */
export async function getNewsList(params) {
    return request('/api/officialwebsite/v1/news/page', {
        method: 'POST',
        data: params
    });
}
/**
 *获取新闻详情
 *
 * @export POST
 * @param {string} code
 * @param {integer} id
 * @returns
 */
export async function getNewsDetail(params) {
    return request('/api/officialwebsite/v1/news/detail', {
        method: 'POST',
        data: params
    });
}
/**
 *新闻置顶
 *
 * @export POST
 * @param {string} code
 * @param {integer} id
 * @returns
 */
export async function getNewsSort(params) {
    return request('/api/officialwebsite/v1/news/top', {
        method: 'POST',
        data: params
    });
}
/**
 *新闻置顶
 *
 * @export POST
 * @param {string} code
 * @param {integer} id
 * @returns
 */
export async function getNewsHide(params) {
    return request('/api/officialwebsite/v1/news/hide', {
        method: 'POST',
        data: params
    });
}

/**
 *新增新闻
 *
 * @export GET
 * @param {string} organizationCode 机构编码
 * @returns
 */
export async function getAddNews(params) {
    return request(`/api/oa/v1/common/select/apply/${params.organizationCode}/${params.iconType}`, {
        method: 'GET'
    });
}
/**
 *编辑新闻
 *
 * @export GET
 * @param {string} applicationNo
 * @returns
 */
export async function getEditNews(params) {
    return request(`/api/oa/v1/office/news/getApplicatiNo/${params.applicationNo}`, {
        method: 'GET'
    });
}
/**
 *获取新闻类别
 *
 * @export GET
 * @param {string} applicationNo
 * @returns
 */
export async function getNewsType() {
    return request('/api/officialwebsite/v1/news/type/list', {
        method: 'GET'
    });
}
